package com.boot.security.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.Pattern;

@Data
@SuperBuilder
@NoArgsConstructor
@ApiModel("注册账户")
public class RegisterAccount {

    @Pattern(regexp = "^[a-zA-Z0-9]{3,16}$", message = "用户名设置3-16位，只包含大小写字母和数字")
    @ApiModelProperty(value = "用户名", name = "username")
    private String username;

    @Pattern(regexp = "^\\w+((.\\w+)|(-\\w+))@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+).[A-Za-z0-9]+$", message = "邮箱格式错误")
    @ApiModelProperty(value = "邮箱", name = "email")
    private String email;

    @Pattern(regexp = "^[a-zA-Z0-9_#@]{6,16}$", message = "密码名设置6-16位，可包括大小写字母、数字和3种特殊字符(_、#、@)")
    @ApiModelProperty(value = "密码", name = "password")
    private String password;

}
